home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: Parent Power / The Sunday Times - Parent Power.iso / pc / engine / home.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-11-03  |  3.0 KB  |  130 lines

  1. function init()
  2. {
  3.    soundFadeInc = 5;
  4.    setupButtons();
  5.    setupAudio();
  6. }
  7. function setupButtons()
  8. {
  9.    var _loc1_ = this;
  10.    var _loc2_ = _parent;
  11.    schools_of_year.onRelease = function()
  12.    {
  13.       _parent.nav.schools_of_year.onRelease();
  14.    };
  15.    schools_of_year.onRollOver = function()
  16.    {
  17.       this.gotoAndStop(2);
  18.    };
  19.    schools_of_year.onRollOut = schools_of_year.onReleaseOutside = function()
  20.    {
  21.       this.gotoAndStop(1);
  22.    };
  23.    league_tables.onRelease = function()
  24.    {
  25.       _parent.nav.league_tables.onRelease();
  26.    };
  27.    league_tables.onRollOver = function()
  28.    {
  29.       this.gotoAndStop(2);
  30.    };
  31.    league_tables.onRollOut = league_tables.onReleaseOutside = function()
  32.    {
  33.       this.gotoAndStop(1);
  34.    };
  35.    search.onRelease = function()
  36.    {
  37.       _parent.nav.search.onRelease();
  38.    };
  39.    search.onRollOver = function()
  40.    {
  41.       this.gotoAndStop(2);
  42.    };
  43.    search.onRollOut = search.onReleaseOutside = function()
  44.    {
  45.       this.gotoAndStop(1);
  46.    };
  47.    features.onRelease = function()
  48.    {
  49.       _parent.nav_activate("");
  50.       _parent.movie_load("features.swf");
  51.    };
  52.    added_content.onRelease = function()
  53.    {
  54.       _parent.nav_activate("");
  55.       _parent.movie_load("added_value.swf");
  56.    };
  57.    added_content.onRollOver = function()
  58.    {
  59.       this.gotoAndStop(2);
  60.    };
  61.    added_content.onRollOut = added_content.onReleaseOutside = function()
  62.    {
  63.       this.gotoAndStop(1);
  64.    };
  65. }
  66. function setupAudio()
  67. {
  68.    var _loc1_ = this;
  69.    mcAudio.onRollOver = function()
  70.    {
  71.       var _loc1_ = this;
  72.       _loc1_.gotoAndStop(2);
  73.       if(_loc1_.blnPlaying == true)
  74.       {
  75.          _loc1_.audiostatus.htmlText = "STOP";
  76.       }
  77.       else
  78.       {
  79.          _loc1_.audiostatus.htmlText = "PLAY";
  80.       }
  81.    };
  82.    mcAudio.onRollOut = mcAudio.onReleaseOutside = function()
  83.    {
  84.       var _loc1_ = this;
  85.       _loc1_.gotoAndStop(1);
  86.       if(_loc1_.blnPlaying == true)
  87.       {
  88.          _loc1_.audiostatus.htmlText = "STOP";
  89.       }
  90.       else
  91.       {
  92.          _loc1_.audiostatus.htmlText = "PLAY";
  93.       }
  94.    };
  95.    var _loc2_ = "home_vo.mp3";
  96.    mcAudio.stopAudio = function()
  97.    {
  98.       var _loc1_ = this;
  99.       _loc1_.blnPlaying = false;
  100.       _loc1_.s.stop();
  101.       _loc1_.audiostatus.htmlText = "PLAY";
  102.       trace("this.blnPlaying: " + _loc1_.blnPlaying);
  103.    };
  104.    mcAudio.playAudio = function()
  105.    {
  106.       var _loc1_ = this;
  107.       _loc1_.blnPlaying = true;
  108.       _loc1_.s.start();
  109.       _loc1_.audiostatus.htmlText = "STOP";
  110.    };
  111.    mcAudio.onPress = function()
  112.    {
  113.       var _loc1_ = this;
  114.       !_loc1_.blnPlaying ? _loc1_.playAudio() : _loc1_.stopAudio();
  115.    };
  116.    mcAudio.s = new Sound();
  117.    mcAudio.s.owner = mcAudio;
  118.    mcAudio.s.onLoad = function()
  119.    {
  120.       trace("* onLoad()");
  121.       this.owner.stopAudio();
  122.    };
  123.    mcAudio.s.onSoundComplete = function()
  124.    {
  125.       this.owner.stopAudio();
  126.    };
  127.    mcAudio.s.loadSound(_loc2_,true);
  128. }
  129. this.audiostatus.htmlText = "Poo";
  130.